<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;

class FilterQueuePublicationRepository extends AbstractRepository
{
    protected $table="filter_queue_publication";
    
    
    public function getByFilter($filterId,$number = 30)
    {
    	$dql = "SELECT c FROM $this->table c WHERE c.filter_id=?1";
    
    	return $this->getEntityManager()->createQuery($dql)
    	->setParameter(1, $filterId)
    	->setMaxResults($number)
    	->getResult();
    }
    
    public function getByUser($userUid,$number = 30)
    {
    	$dql = "SELECT c FROM $this->table c WHERE c.user_uid=?1";
    
    	return $this->getEntityManager()->createQuery($dql)
    	->setParameter(1, $userUid)
    	->setMaxResults($number)
    	->getResult();
    }
    
}